package com.example.professorevaluation.dao

import androidx.room.*
import com.example.professorevaluation.bean.ProfessorBean

@Dao
interface ProfessorDao {
    @Query("select * from t_professor")
    fun getAll(): List<ProfessorBean>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertOne(teacher: ProfessorBean):Long

    @Query("select * from t_professor where name = :name")
    fun selectOne(name:String):ProfessorBean

    @Delete
    fun delete(professorBean: ProfessorBean)

    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun update(professorBean: ProfessorBean)
}